package cn.anecansaitin.jep.parser.ast.node.expression.literal;

import cn.anecansaitin.jep.Token;
import cn.anecansaitin.jep.TokenType;
import cn.anecansaitin.jep.types.TypeInfo;

public final class IntLiteral extends Literal {
    public final int value;

    public IntLiteral(Token intToken) {
        this(intToken.value(), intToken.line(), intToken.column());
    }

    public IntLiteral(String value, int line, int column) {
        super(TokenType.INT_LITERAL, TypeInfo.INT, line, column);
        this.value = Integer.parseInt(value);
    }

    public int value() {
        return value;
    }
}